← Back
Editing: index30.js
import{_ as e}from"./index93.js?v=1765440387";import{_ as a}from"./index91.js?v=1765440387";import{k as t,r as i,c as n,e as s,aR as l,bb as r,w as o,p as c,a5 as m,q as u,v as p,A as d,y as _,x as h,O as b}from"./base-lib.js?v=1765440387";import{ay as v,a8 as f,K as y,bZ as C,o as w,bY as g,l as j,L as k,u as x,aM as R,a6 as E,A as L,v as T,R as D,N as I,e as O}from"./utils-lib.js?v=1765440387";import{o as A,b as V,a as P,N as B}from"./useMethods.js?v=1765440387";import{c as N,a as q,u as z}from"./column.js?v=1765440387";import"./__commonjsHelpers__.js?v=1765440387";import"./index94.js?v=1765440387";const{refs:{customLimit:H,isRefreshTableList:J},getCurrentCon:K}=v(),M=t({search:"",isRefresh:!0}),S=i([]),U=[{active:!0,label:"从仓库中拉取",type:"button",onClick:()=>{j({component:()=>k(()=>import("./index208.js?v=1765440387"),__vite__mapDeps([]),import.meta.url),title:"拉取镜像",area:64})}},{active:!1,label:"导入镜像",type:"button",onClick:()=>{j({component:()=>k(()=>import("./index209.js?v=1765440387"),__vite__mapDeps([]),import.meta.url),title:"导入镜像",area:43,btn:"导入"})}},{active:!1,label:"构建镜像",type:"button",onClick:()=>{j({component:()=>k(()=>import("./index210.js?v=1765440387"),__vite__mapDeps([]),import.meta.url),title:"构建镜像",area:54,btn:"提交"})}},{active:!1,label:"线上镜像",type:"button",onClick:()=>{j({component:()=>k(()=>import("./index29.js?v=1765440387").then(e=>e.a),__vite__mapDeps([]),import.meta.url),title:"Docker线上镜像搜索",area:80})}},{active:!1,label:"清理镜像",type:"button",onClick:async()=>{j({component:()=>k(()=>import("./clear-confirm.js?v=1765440387"),__vite__mapDeps([]),import.meta.url),title:"清理镜像",area:35,btn:!0})}}],W=e=>{j({component:()=>k(()=>import("./index211.js?v=1765440387"),__vite__mapDeps([]),import.meta.url),title:"推送【".concat(e.name,"】到仓库"),area:43,btn:!0,compData:{row:e}})},Y=e=>{j({component:()=>k(()=>import("./index212.js?v=1765440387"),__vite__mapDeps([]),import.meta.url),title:"导出【".concat(e.name,"】镜像"),area:43,btn:"导出",compData:{row:e}})},Z=async e=>{P({image:e.name})},F=f([{label:"删除项目",value:"delete",event:async(e,a,t,i,n)=>{const{label:s,value:l}=i,r=async(e,a)=>{const{id:t,name:i}=e;if("delete"===l){const e={id:t,name:i,force:"0"};return await g({data:JSON.stringify(e)})}};await e({title:"批量".concat(s,"镜像"),content:"批量".concat(s,"已选的镜像,是否继续操作!"),column:[{label:"镜像名",prop:"name"},N()],onConfirm:async()=>(await a(r),J.value=!0,!1)})}}]),G=async(e,a)=>{if(J.value=!1,a)return(async(e,a)=>{try{const t=e.toLowerCase(),i=["name","id","container"],n=S.value.filter(e=>{const a={...e,container:e.containers.map(e=>e.container_name).join("")||""};return i.some(e=>{var i;return null==(i=a[e])?void 0:i.toLowerCase().includes(t)})});return{data:V({limit:a.limit,list:n,p:a.p})||[],total:n.length}}catch(t){return{data:[],total:0}}})(e.search,e);if(!M.isRefresh)return{data:V({limit:e.limit,list:S.value,p:e.p})||[],total:S.value.length};M.isRefresh=!1;const t=await y({request:C(),data:Array});return S.value=t,{data:V({limit:e.limit,list:S.value,p:e.p})||[],total:S.value.length}},Q=(e,a)=>{setTimeout(()=>{H.value.images||((e,a)=>{setTimeout(()=>{e.value>900?a.value.limit=20:a.value.limit=10},0)})(e,a)},0)},X={class:"relative"},$={class:"flex items-center"},ee=O(n({__name:"index",setup(t){const{refs:{isRefreshTableList:i}}=v(),{mainHeight:n}=x(),{BtOperation:f}=R({options:U});let C=!1;const j=(e,a)=>{M.isRefresh=!0,e&&!isNaN(e)&&(H.value.p=e),a?(H.value.search=a,C=!0):C=!1,N()},{BtTable:k,BtPage:O,BtBatch:V,BtColumn:P,refresh:N,param:H}=E({request:e=>G(e,C),columns:[q(),{label:"ID",prop:"id",width:110,render:e=>{const a=e.id.slice(7);return s(l,{placement:"top"},{default:()=>s("div",{onClick:()=>L({value:e.id})},[a.slice(0,12)]),content:()=>s("div",null,[e.id])})}},{label:"镜像名",prop:"name",isCustom:!0},{label:"大小",prop:"size",width:100,isCustom:!0,render:e=>T(e.size)},{label:"创建时间",prop:"time",width:160,isCustom:!0,render:e=>D(e.time)},{label:"使用镜像的容器",prop:"used",minWidth:180,isCustom:!0,render:e=>1!==e.used?"--":I(e.containers)&&e.containers.length>0?s("span",{class:"flex items-center whitespace-pre-wrap gap-4 min-h-[3rem]"},[e.containers.map(e=>s(r,{class:"mr-1 cursor-pointer",type:"success",size:"small",onClick:()=>(async e=>{const a={id:e.container_id,name:e.container_name};await K(a.id),A(a)})(e)},{default:()=>[e.container_name]}))]):"--"},z([{onClick:Z,width:80,title:"创建容器"},{onClick:W,title:"推送"},{onClick:Y,title:"导出"},{onClick:e=>(async(e,a)=>{const t={id:e.id,name:e.name,force:"0"};try{await w({type:"calc",title:"删除镜像【".concat(e.name,"】"),width:"35rem",content:"您真的要删除镜像【".concat(e.name,"】吗?")}),y({request:g({data:JSON.stringify(t)}),message:!0,success:()=>{a()}})}catch(i){}})(e,j),title:"删除"}])],extension:[F]});return o(()=>i.value,e=>{e&&(j(),i.value=!1)}),c(async()=>{Q(n,H)}),m(()=>{M.search="",M.isRefresh=!0,S.value=[]}),(t,i)=>{const l=a,r=e;return u(),p("div",X,[s(r,null,{"header-left":d(()=>[_("div",$,[s(h(f)),_("a",{class:"ml-[1rem] bt-link",onClick:i[0]||(i[0]=(...e)=>h(B)&&h(B)(...e))},"需求反馈")])]),"header-right":d(()=>[s(l,{icon:"el-search",class:"!mr-[1rem] !w-[26rem]",modelValue:h(M).search,"onUpdate:modelValue":i[1]||(i[1]=e=>h(M).search=e),clearable:"",placeholder:"镜像名、ID、使用的容器",onIconClick:i[2]||(i[2]=e=>j(1,h(M).search)),onClear:i[3]||(i[3]=e=>j(1)),onKeyup:i[4]||(i[4]=b(e=>j(1,h(M).search),["enter"]))},null,8,["modelValue"]),s(h(P))]),content:d(()=>[s(h(k),{key:"ImageTable","max-height":h(n)-220},null,8,["max-height"])]),"footer-left":d(()=>[s(h(V))]),"footer-right":d(()=>[s(h(O))]),popup:d(()=>[...i[5]||(i[5]=[])]),_:1})])}}}),[["__scopeId","data-v-71d635d4"]]);export{ee as default}; function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { __vite__mapDeps.viteFileDeps = [] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) }
Save File
Cancel